var util = require("../../../utils/util.js"),
api = require("../../../utils/api.js"), 
app = getApp();
Page({
    data: {
        info: {},
        bannerList: [],
        tags: [],
        // isIphoneX: i.globalData.isIphoneX,
        bottom: 0,
        shareShow: !1,
        shareData: {},
        article_id: "",
        imgUrl:app.globalData.baseImgUrl,
        basevideoUrl:app.globalData.basevideoUrl
    },
    onLoad: function(e) {
        this.setData({article_id:e.id})
        let pages = getCurrentPages();
        if(pages && pages.length < 3){
          api.default.toLogin({}).then(res => {
            this.serverDetail()
          })
        }else{
          this.serverDetail()
        }
    },
    async serverDetail(){
        var parmes = {
            id: this.data.article_id
        };
        let {data}=await api.default.articleDetail(parmes);
        if(data){
            this.setData({info:data})
        }
        
    },
    onShow: function() {},
    onShareAppMessage: function(e) {
      return  util.shareEvent(e,{
        path:'/pages/home/articel/articleDetail?id='+this.data.article_id
      })
    },
});